#include<stdio.h>
#include<string.h>
#define NameSize 20

struct Student
{
    char Name[NameSize];
    int Score;
    int class;
};
typedef struct Student Stu;

void InitStu(Stu* s,const char *Name,int Score,int class)
{
    strcpy(s->Name,Name);
    s->class = class;
    s->Score = Score;
}
void PrintStu(Stu* s)
{
    printf("name : %s score : %d class : %d\n",s->Name,s->Score,s->class);
}

int main()
{
    //初始化
    Stu s = {"zhangsan",100,9};
    printf("name : %s score : %d class : %d\n",s.Name,s.Score,s.class);

    s.Score = 90;
    s.class = 10;
    strcpy(s.Name,"lisi");
    printf("name : %s score : %d class : %d\n",s.Name,s.Score,s.class);

    // Stu s[3];
    // strcpy(s[0].Name,"zhangsan");
    // s[0].Score = 100;
    // s[0].class = 10;
    // printf("name : %s score : %d class : %d\n",s[0].Name,s[0].Score,s[0].class);

    Stu s[3];
    InitStu(s,"zhangsan",100,9);
    PrintStu(s);

    InitStu(s+1,"lisi",100,10);
    PrintStu(s+1);

    InitStu(s+2,"wangwu",100,10);
    PrintStu(s+2);
    
    return 0;
}